package com.zpark.ribbon.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @PackageName: com.zpark.ribbon.controller
 * @ClassName: Ribbon02Controller
 * @Description:
 * @author: RZS
 * @date: 2022/11/22  10:21
 */
@RestController
@RequestMapping("/ribbon02")
public class Ribbon02Controller {

    @Autowired
    private RestTemplate restTemplate;

    private final static String PTAH = "http://server-ribbon/server";

    @RequestMapping("/r2.do")
    public String getP(){
        return restTemplate.getForObject(PTAH + "/port", String.class);
    }

}
